home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SCREEN.SWG / 0074_Text Modes.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  3KB  |  106 lines

  1. {
  2. This is some code I did for someone.  I figure they may be one of you all
  3. that need it. Also put it in SWAG if you like it.
  4.  
  5. This will let you change between the 6 most common text modes!  Nice easy to
  6. read code I think. <grin>
  7.  
  8. (* Info:                                                                 *)
  9. (*                                                                       *)
  10. (*  Forbis's Cool Text Mode Thing v0.01                                  *)
  11. (*  by: Chris Forbis                                                     *)
  12. (*  CopyRight 1994 . All Rights Reserved                                 *)
  13. (*                                                                       *)
  14. (* About:                                                                *)
  15. (*  I worked on this one day when well I just had to get into 132x25x16! *)
  16. (*  Enjoy!  Please don't hack this up!  If you use  ease give me a little*)
  17. (*  credit where it is due.                                              *)
  18. (*                                                                       *)
  19. (* Getting Hold Of Me:                                                   *)
  20. (*                                                                       *)
  21. (* InterNet:  forbis@vsl.ist.ucf                                         *)
  22. (* FidoNet :  1:363/246                                                  *)
  23. (*            Pascal and Pascal Lessons Areas                            *)
  24. (* BBS     :  Darkened Lands (407)679-3449                               *)
  25. }
  26. program TEXTMODE;
  27.  
  28. procedure SetMode_80_25_16; assembler;
  29. asm
  30.   mov ax, 03h
  31.   int 10h
  32. end;
  33.  
  34. procedure SetMode_80_25_2; assembler;
  35. asm
  36.   mov ax, 07h
  37.   int 10h
  38. end;
  39.  
  40. procedure SetMode_80_60_16; assembler;
  41. asm
  42.   mov ax, 4Eh
  43.   int 10h
  44. end;
  45.  
  46. procedure SetMode_132_60_16; assembler;
  47. asm
  48.   mov ax, 4Fh
  49.   int 10h
  50. end;
  51.  
  52. procedure SetMode_132_25_16; assembler;
  53. asm
  54.   mov ax, 50h
  55.   int 10h
  56. end;
  57.  
  58. procedure SetMode_132_43_16; assembler;
  59. asm
  60.   mov ax, 51h
  61.   int 10h
  62. end;
  63.  
  64. procedure HelpMenu;
  65. begin
  66.   writeln('■ Forbis''s Cool Text Mode Thing! v0.01');
  67.   writeln('────────────────────────────────────────');
  68.   writeln('Usage: TEXTMODE <MODE>');
  69.   writeln;
  70.   writeln('MODE:');
  71.   writeln('       0 : 80x 25y 16c   Mode: 03h');
  72.   writeln('       1 : 80x 25y 2c    Mode: 07h');
  73.   writeln('       2 : 80x 60y 16c   Mode: 4Eh');
  74.   writeln('       3 : 132x 60y 16c  Mode: 4Fh');
  75.   writeln('       4 : 132x 25y 16c  Mode: 50h');
  76.   writeln('       5 : 132x 43y 16c  Mode: 51h');
  77.   writeln('────────────────────────────────────────');
  78.   writeln('I will not be held liable if this messes');
  79.   writeln('up your machine!');
  80.   writeln('────────────────────────────────────────');
  81. end;
  82.  
  83. var
  84.   st : string[1];
  85.   ch : char;
  86.  
  87. begin
  88.   if (paramcount = 0) then begin
  89.     HelpMenu;
  90.   end else begin
  91.     st := paramstr(1);
  92.     ch := st[1];
  93.     case upcase(ch) of
  94.       '0' : SetMode_80_25_16;
  95.       '1' : SetMode_80_25_2;
  96.       '2' : SetMode_80_60_16;
  97.       '3' : SetMode_132_60_16;
  98.       '4' : SetMode_132_25_16;
  99.       '5' : SetMode_132_43_16;
  100.       else HelpMenu;
  101.     end;
  102.   end;
  103.   writeln('Thanks for using Forbis''s Cool Text Mode Thing!');
  104.   readln;
  105. end.
  106.